#!/usr/bin/env python
# _*_ coding: utf-8 _*_
# @Time : 2020/7/7 4:46
# @Author : LZQ
# @Version：V 0.1
# @File : BaseModel.py
# @desc :
from __init__ import db
from datetime import datetime



class BaseModel(object):
    create_time = db.Column(db.DateTime, default=datetime.now())
    update_time = db.Column(db.DateTime, default=datetime.now())

    def add_update(self):
        db.session.add(self)
        db.session.commit()

    def delete(self):
        db.session.delete(self)
        db.session.commit()
